// ==UserScript==
// @name           Second Life HTTP IN data URI loader
// @namespace      http://blog.signpostmarv.name/2008/10/21/userscript-to-circumvent-lack-of-content-type-header-setting-support/
// @description    Loads data URIs to circumvent lack of Content-Type header setting support
// @include        http://*.aditi.lindenlab.com:*/cap/*
// @version	1.0
// ==/UserScript==
if(document.location.hash == '#disable')
{
	return;
}
var doc = document.getElementsByTagName('pre');
var mime_types = ['text/html','application/xhtml+xml','image/svg+xml'];
var comma_pos;
var mime;
if(doc){
	doc = doc[0].firstChild.nodeValue;
	if(doc.substring(0,5) == 'data:' && (comma_pos = doc.indexOf(',')) != -1)
	{
		mime = doc.substring(5,comma_pos);
		for(i=0;l=mime_types.length;++i)
		{
			if(mime_types[i] == mime)
			{
				document.location.hash = 'disable';
				document.location = doc;
				break;
			}
		}
	}
}